//定义组件
var Demo = React.createClass({
    //定义状态
    getInitialState:function () {
      return{
          url:'demo.jpg',
          width:500
      }
    },
    render:function () {
        return(
            <div>
                <div ref="container" className="container"></div>
                <div className="small-img">
                    <img src={this.state.url} width="60" alt=""/>
                </div>
            </div>
        )
    },
    //使用非React类库，只能在组件构建完成时候使用
    componentDidMount:function () {
        new ImageZoom(
            this.state.url,
            this.state.width,
            this.refs.container
        )
    }
})
ReactDOM.render(<Demo/>,app);